<!DOCUMENT HTML>
<html>
    <head>
  <script type="text/javascript" src="js/hero.js">
  //hero框架核心
  </script>
  <script type="text/javascript">
  //boot 函数会在页面第一次加载完成后调用，将对象置入viewWillAppear中的目的是在页面每次展现的时候发送出去
  // API.boot = function(){
  //  API.out({command:{viewWillAppear:[
  //    {ip:'a'}
  //  ]}});
  // }
  //finishLoading通过globle通知发送告诉app关闭封面，每个app的首页发送这个通知即可
  setTimeout(function() {
    API.out({globle:{key:'finishLoading'}});
  }, 100);
  //开发过程中使用定时刷新实现即时性效果
  // setTimeout(function() {
  //   API.out({command:'refresh'});
  // }, 1500);

  var ui = {
  backgroundColor:'aaaaaa',//整页背景色
  tintColor:'303e53',//着色
  //导航栏显示内容
  nav:{
    title:"start"
  },
  views:
[
  //一个界面元素
  {
    class:"HeroLabel",
    name:"name",
    textColor:"ffffff",
    text:"Hello sdfs !",
    size:22,
    frame:{"w":"1x",h:"80"},
    alignment:"center"
  },
  {
    class:"HeroButton",
    titleColor:"ffffff",
    title:"第一次交互",
    backgroundColor:'ff0000',
    cornerRadius:10,
    size:16,
    frame:{w:"0.5x",h:"44"},
    center:{x:"0.5x",y:"0.9x"},
    click:{datas:[{name:'name',text:'You are hero !',size:56}]}
  },
  {
    class:"HeroButton",
    titleColor:"ffffff",
    title:"Hero,  ",
    backgroundColor:'ff0000',
    cornerRadius:150,
    borderWidth:2,
    borderColor:'22ff22',
    size:16,
    frame:{w:"300",h:"300"},
    center:{x:"0.5x",y:"0.5x"},
  },


]
};
</script>
</head>
</html>
